There are many marshalling/serializing frameworks that purport to know what data needs to be serialized in order to save the state of a given, pre-existing object; and how to reconstruct the same object given the serialized representation. Java™ Serialization, XMI™, SOAP, ValueClasses, and JVT's provide some examples of such marshalling/serializing frameworks.
In addition, there is the Universal Test Client in WSAD™, which addresses marshalling/serializing issues in a data and behavioral manner. It allows the user to construct objects of arbitrary data types by first allowing the user to choose one of the available constructors for the object, and to specify the data for that constructor; and then subsequently allowing the user to execute methods of that object, and again pass data into those methods, in order to complete the process of driving it into the desired state.